package interfaz;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class DialogoDescarga extends JDialog
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public DialogoDescarga(InterfazCorreo ic)
	{
		super(ic, true);

		setTitle("Descargando mensajes");

		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);

		JPanel contentPane = new JPanel();
		contentPane.setBorder(
				BorderFactory.createEmptyBorder(5, 5, 5, 5));
		contentPane.add(new JLabel("Descargando mensajes... \n Por favor espere"));
		setContentPane(contentPane);

		pack();
		centrarVentana();
	}
	
	/**
     * Centra la ventana en la pantalla
     */
    private void centrarVentana( )
    {
        Dimension pantalla = Toolkit.getDefaultToolkit( ).getScreenSize( );
        setLocation( ( int ) ( pantalla.getWidth( ) / 2 - getWidth( ) / 2 ), ( int ) ( pantalla.getHeight( ) / 2 - getHeight( ) / 2 ) );
    }
      
}
